{% extends 'base.html' %}
{% load static %}
{% load bootstrap4 %}

{% block title %}
    {{ block.super }} |
    {% if 'add' in request.get_full_path %}
        添加台网信息
    {% else %}
        更新台网信息
    {% endif %}
{% endblock %}

{% block content %}
    <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">

        {% if 'add' in request.get_full_path %}
            <h1>台站<a href="{{ station.get_absolute_url }}">{{ station.network.code }}/{{ station.code }}</a>设备列表 | 添加
            </h1>
        {% else %}
            <h1>台站<a href="{{ station.get_absolute_url }}">{{ station.network.code }}/{{ station.code }}</a>设备列表 | 更新
            </h1>
        {% endif %}

        <div class="btn-toolbar mb-2 mb-md-0">
            <div class="btn-group mr-2">
                <button class="btn btn-sm btn-outline-secondary">Share</button>
                <button class="btn btn-sm btn-outline-secondary">Export</button>
            </div>
            <button class="btn btn-sm btn-outline-secondary dropdown-toggle">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
                     stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
                     class="feather feather-calendar">
                    <rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
                    <line x1="16" y1="2" x2="16" y2="6"></line>
                    <line x1="8" y1="2" x2="8" y2="6"></line>
                    <line x1="3" y1="10" x2="21" y2="10"></line>
                </svg>
                This week
            </button>
        </div>
    </div>

    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="/">首页</a></li>
            <li class="breadcrumb-item active" aria-current="page">Library</li>
        </ol>
    </nav>

    <form method="post" class="col-8">
        {% csrf_token %}
        {% bootstrap_form form %}

        {{ equipmentitems.management_form }}
        {% for form in equipmentitems.forms %}
            {% bootstrap_form form %}
            {{ form.media }}
        {% endfor %}

        {% buttons %}
            <button type="reset" class="btn btn-dark">重置</button>
            {% if 'add' in request.get_full_path %}
                <button type="submit" class="btn btn-primary">保存</button>
            {% else %}
                <button type="submit" class="btn btn-primary">更新</button>
            {% endif %}
        {% endbuttons %}
    </form>

{% endblock %}
